using System;
using Tarkin.InfrastructureLibrary.Utilities.Collections;

namespace Tarkin.InfrastructureLibrary.Core.Basic
{
    /// <summary>
    /// The Comment class is the implementation of the Core::Basic Comment class as defined by 
    /// section 10.1.1 of the Unified Modeling Language: Infrastructure specfication (version 
    /// 2.1.1, dated 07-02-06).
    /// </summary>
    /// <remarks>Tarkin classes are NOT thread-safe.</remarks>
    public class Comment
    {

#region Private Members

        /// <summary>
        /// Specifies a string that is the comment.
        /// </summary>
        private string body = string.Empty;

        /// <summary>
        /// Any elements annotated by the Comment.
        /// </summary>
        private Set < Element >  annotatedElements = null;

#endregion


#region Constructors

        /// <summary>
        /// Overloaded constructor.
        /// </summary>
        /// <param name="body">Specifies a string that is the comment.</param>
        public Comment ( string body )
        {
            Body = body;
        }


#endregion


#region Public Properties

        /// <summary>
        /// Specifies a string that is the comment.
        /// </summary>
        public string Body
        {
            get
            {
                return body;
            }

            set
            {
                body = value;
            }
        }

        /// <summary>
        /// Any Elements annotated by the Comment.
        /// </summary>
        public Set < Element > AnnotatedElements
        {
            get
            {
                if ( annotatedElements == null )
                {
                    annotatedElements = new Set < Element > ();
                }

                return annotatedElements;
            }
        }

#endregion

    }
}
